package run

import (
	"flag"
	"fmt"
	"gin-extend-demo/routers"
	"os"

	"gitee.com/fkil555/gin-extend/app"
)

func NewAPI() {
	flag.Parse()
	app, err := app.New()
	if err != nil {
		fmt.Fprintln(os.Stderr, "框架启动失败,原因：", err)
		return
	}

	routers.SetupAPIRouters(app)
	
	if err = app.Run(); err != nil {
		fmt.Fprintln(os.Stderr, "框架启动失败,原因：", err)
		return
	}
}
